#!/bin/sh
#
# /etc/rc.d/alsa: store/restore ALSA mixer levels
#

. /etc/rc.subr

# location of the alsactl executable
ALSACTL=/usr/sbin/alsactl

case $1 in
	start)
		if [ -f /var/lib/alsa/asound.state ]; then
			msg "Restoring ALSA volume state..."
			$ALSACTL restore
		fi
		;;
	stop)
		msg "Saving ALSA volume state..."
		$ALSACTL store
		;;
	restart)
		$0 stop
		sleep 2
		$0 start
		;;
	*)
		echo "Usage: $0 [start|stop|restart]"
		;;
esac

# End of file
